<html><head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Conteur" rel="Chapter" href="Conteur.html"><title>Conteur.is_it_the_end</title>
</head>
<body>
<code class="code"><span class="keyword">let</span>&nbsp;is_it_the_end&nbsp;()&nbsp;=<br>
<span class="comment">(*l'indentation&nbsp;de&nbsp;cette&nbsp;fonction&nbsp;n'est&nbsp;pas&nbsp;canonique&nbsp;mais&nbsp;est&nbsp;plus&nbsp;lisible&nbsp;qu'un&nbsp;escalier*)</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span>&nbsp;array_all&nbsp;(&nbsp;<span class="keyword">fun</span>&nbsp;pers<span class="keywordsign">-&gt;</span>perso_is_dead&nbsp;pers)&nbsp;c_whoswho&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">(*tout&nbsp;le&nbsp;monde&nbsp;est&nbsp;mort*)</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">then</span>&nbsp;(id_end&nbsp;:=&nbsp;0;&nbsp;<span class="keyword">true</span>)&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">else</span>&nbsp;<span class="keyword">if</span>&nbsp;array_all&nbsp;(<span class="keyword">fun</span>&nbsp;pers<span class="keywordsign">-&gt;</span>pers&nbsp;&lt;&gt;&nbsp;<span class="constructor">Loup</span>)&nbsp;c_whoswho&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">(*tout&nbsp;les&nbsp;loups&nbsp;sont&nbsp;morts*)</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">then</span>&nbsp;(id_end&nbsp;:=&nbsp;1;&nbsp;<span class="keyword">true</span>)&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">else</span>&nbsp;<span class="keyword">if</span>&nbsp;array_all&nbsp;(<span class="keyword">fun</span>&nbsp;pers<span class="keywordsign">-&gt;</span>pers&nbsp;=&nbsp;<span class="constructor">Loup</span>&nbsp;<span class="keywordsign">||</span>&nbsp;perso_is_dead&nbsp;pers)&nbsp;c_whoswho&nbsp;<span class="comment">(*les&nbsp;loups&nbsp;garous&nbsp;gagnent&nbsp;la&nbsp;partie*)</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">then</span>&nbsp;(id_end&nbsp;:=&nbsp;2;&nbsp;<span class="keyword">true</span>)&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">else</span>&nbsp;<span class="keyword">false</span></code></body></html>